package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

@TableName("t_shoppingCar")
public class ShoppingCarBean {
    /**
     * 购物车ID
     */
    @TableId(value = "pk_shoppingCarId",type = IdType.AUTO)
    private Integer id;
    /**
     * 购买数量
     */
    @TableField("s_num")
    private Integer buyNum;
    /**
     * 商品对象
     */
    @TableField(exist = false)
    private ProductBean product;

    /**
     * 用户ID
     */
    @TableField("fk_userId")
    private Integer userId;

    /**
     * 商品ID
     */
    @TableField("fk_productId")
    private Integer productId;

    public ShoppingCarBean() {
    }

    public ShoppingCarBean(Integer buyNum, Integer userId, Integer productId) {
        this.buyNum = buyNum;
        this.userId = userId;
        this.productId = productId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getBuyNum() {
        return buyNum;
    }

    public void setBuyNum(Integer buyNum) {
        this.buyNum = buyNum;
    }

    public ProductBean getProduct() {
        return product;
    }

    public void setProduct(ProductBean product) {
        this.product = product;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    @Override
    public String toString() {
        return "ShoppingCart{" +
                "id=" + id +
                ", buyNum='" + buyNum + '\'' +
                ", product=" + product +
                ", userId=" + userId +
                ", productId=" + productId +
                "}\n";
    }
}
